<template>
	<div class="myVideo" v-show="!item.common.isHidden" :style="commonStyle">
		<video :src="item.common.src" controls :poster="item.common.poster"></video>
	</div>
</template>

<script>
	import calcBaseStyle from '../libs/calcBaseStyle'
	export default {
		name: 'myVideo',
		props:{
			pageConfig: {
				type: Object,
				default(){
					return {}
				}
			},
			pcid: null
		},
		data(){
			return {
				item: {common: {},style: {},children:[]},
			}
		},
		computed:{
			commonStyle(){
				return calcBaseStyle(this.item,this.pageConfig.contentH)
			},
		},
		created() {
			this.$parent.widgetList.some(widget=>{
				if(widget.cid === this.pcid){
					this.item = widget
					return true
				}
			})
		},
	}
</script>

<style lang="less" scoped>
	.myVideo{
			position: absolute;
			overflow: hidden;
			video{
				width: 100%;
				height: 100%;
			}
		}
</style>
